import compose from 'koa-compose';
import cors from 'koa2-cors';
import urlsniffer from "./urlsniffer";

const router = require('koa-router')({
  prefix: '/website/auxiliaryTool/api'
});

router.use('/urlsniffer',urlsniffer.routes());

module.exports = compose([
  cors({
    origin: function (ctx) { //设置允许来自指定域名请求
      return '*'; // 允许来自所有域名请求
    },
    methods: ['GET', 'HEAD', 'POST']
  }),
  router.routes(),
  router.allowedMethods()
])